﻿#include <QtLocation/private/qgeotiledmappingmanagerengine_p.h>

#include "QGeoServiceProviderPluginCustom.h"
#include "QGeoCodingManagerEngineCustom.h"
#include "QGeoTiledMappingManagerEngineCustom.h"

Q_EXTERN_C Q_DECL_EXPORT const char *qt_plugin_query_metadata();
Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance();

const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_QGeoServiceProviderFactoryCustom()
{
    QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance, qt_plugin_query_metadata};
    return plugin;
}

QGeoCodingManagerEngine *QGeoServiceProviderFactoryCustom::createGeocodingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
{
    return new QGeoCodingManagerEngineCustom(parameters, error, errorString);
}

QGeoMappingManagerEngine *QGeoServiceProviderFactoryCustom::createMappingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
{
    // QGeoTiledMappingManagerEngineCustom 的构造中使用 QGeoTileFetcherCustom 来加载瓦片
    return new QGeoTiledMappingManagerEngineCustom(parameters, error, errorString);
}

QGeoRoutingManagerEngine *QGeoServiceProviderFactoryCustom::createRoutingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
{
    // Not implemented for this App
    Q_UNUSED(parameters)
    Q_UNUSED(error)
    Q_UNUSED(errorString)
    return nullptr;
}

QPlaceManagerEngine *QGeoServiceProviderFactoryCustom::createPlaceManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
{
    // Not implemented for this App
    Q_UNUSED(parameters)
    Q_UNUSED(error)
    Q_UNUSED(errorString)
    return nullptr;
}
